<template>
  <van-sticky :offset-top="0">
    <van-nav-bar
      :title="title"
      left-text=""
      :left-arrow="['购物车', '我的', '登录', '注册'].includes(title) ? false : true"
      @click-left="onClickLeft"
    />
  </van-sticky>
</template>
<script setup>
import { defineProps } from "vue";
import { useRouter } from "vue-router";
const prop = defineProps({
  title: {
    type: String,
    default: "",
  },
});
const router = useRouter();
const onClickLeft = () => {
  router.go(-1);
};
</script>
<style>
.header {
  position: fixed;
  top: 0;
  width: 100%;
}
</style>
